package com.hist.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.hist.service.LoginService;

@Controller
public class LoginController {
	   @Autowired
	   LoginService service;
	
	   @ResponseBody
	   @RequestMapping("/username")
	public Integer checkUsername(Integer username)
	  {
		   return service.checkUsername(username);
	  }
	   @ResponseBody
	   @RequestMapping("/insertAccount")
	public void insertLogin(Integer username, String password) {
		// TODO Auto-generated method stub
		 service.insertLogin(username,password);
	}
	   /*增加学生信息*/
	   @ResponseBody
       @RequestMapping("/insertStudent") 
	   public void insertStudent(Integer sno,String sname,String ssex,Integer sage,String sdept,String smajor,Integer sgrade,Integer school_length,String saddress,String spol,String snation,String srp,String smove)
	   {  
		   service.insertStudent(sno,sname,ssex,sage,sdept,smajor,sgrade,school_length,saddress,spol,snation,srp,smove);
		   
	    }
	   @ResponseBody
	   @RequestMapping("/getLogin")
		public Integer getLogin(Integer username, String password) {
			return service.getLogin(username,password);
		}
	   
}

